package com.medical.controller;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.medical.po.Userinfo;
import com.medical.service.UserinfoService;

@Controller
@RequestMapping(value="/user")
/**
 * 
 * @author LTT-AH-ZY
 * @date 创建时间：2017年7月24日 下午5:07:52 
 * @version 1.0
 * @parameter 参数及其意义
 * @return 返回值
 * @throws 异常类及抛出条件
 */
public class UserController {
	/**
	 * 注入UserinfoService服务
	 */
	@Autowired
	private UserinfoService uSerinfoService ;
	/**
	 * 
	 * @param userinfo
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/useradd")
	public @ResponseBody int doctors(@RequestBody Userinfo userinfo,HttpServletRequest request) throws Exception {
		
		System.out.println("进入。。。"+userinfo.toString()+request);
		// 调用service插入数据
		int zt = uSerinfoService.insertSelective(userinfo);
		return zt;

	}

}
